<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>直接在表单上调用事件</title>
</head>
<body>
	<h1>直接在表单上调用事件</h1><hr>
	<form name="myForm" id="myForm" action="#" method="get" onsubmit="alert('提交已确认'); return false;">
		<input name="mySubmit" id="mySubmit" type="submit" value="单击这里提交" onclick="alert('确认提交');">
	</form>
	<script type="text/javascript">
		//自动载入click功能
		document.forms["myForm"].mySubmit.click();
	</script>
</body>
</html>